import re

def split_sub_string(input_string):
    # 匹配<sub>标签内容
    input_string = str(input_string)
    pattern = r"(.*?)<sub>(.*?)</sub>|(.+)"
    matches = re.findall(pattern, input_string)

    result = []
    for match in matches:
        normal_text, sub_text, remaining_text = match

        # 添加普通文本
        if normal_text:
            result.append({"content": normal_text, "subSuperScript": 0})
        if remaining_text:
            result.append({"content": remaining_text, "subSuperScript": 0})

        # 添加下标内容
        if sub_text:
            result.append({"content": sub_text, "subSuperScript": 2})

    return result

if __name__ == "__main__":
    input_string = "A cabinet loss + B cabinet loss ="
    result = split_sub_string(input_string)
    print(result)